
import React from 'react';
import ReactDom from 'react-dom'
import './search.less'
import logo from '../images/logo.jpg'
import '../../common'
import {a} from './tree-shaking'
class Index extends React.Component{

	constructor() {
		super(...arguments);
		this.state ={
			Text:null
		}
	}
	loadComponent () {
		import('./test.js').then((Text) => {
			this.setState({
				Text:Text.default
			})
		})
	}
	render() {
		const {Text} = this.state;
		return (
			<div className={'search-text'}>
				{a()}Search
				{Text ? <Text/> : null}
				<img src={logo} onClick={this.loadComponent.bind(this)}/>
			</div>
		)
	}
}

ReactDom.render(
	<Index/>,
	document.getElementById('root')
)
